import java.util.Scanner;
public class exam {
public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
        System.out.println("请输入期末考试成绩：");
        int score = scanner.nextInt();
        
        if (score >= 90 && score <= 100) {
            System.out.println("优秀，等级为A");
        } else if (score >= 70 && score <= 89) {
            System.out.println("良好，等级为B");
        } else if (score >= 60 && score <= 69) {
            System.out.println("合格，等级为C");
        } else if (score >= 0 && score <= 59) {
            System.out.println("不合格，等级为D");
        } else {
            System.out.println("输入成绩无效");
        }
    }
}